// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 注册
import sign from '@/views/sign';

// 欢迎页
import welcome from '@/views/welcome/welcome';

// 测试页
import test from '@/views/test/mytest';
// 首页
import index from '@/views/index';

/**
 * 申请提交
 */
// 入库申请
import inapply from '@/views/apply/inapply';
// 出库申请
import outapply from '@/views/apply/outapply';
// 库存转移申请
import transferapply from '@/views/apply/transferapply';

/**
 * 入库申请查询
 */
// 入库申请查询
import inselect from '@/views/inmanage/inselect';

/**
 * 出库申请查询
 */
// 出库申请查询
import outselect from '@/views/outmanage/outselect';

/**
 * 仓库管理
 */
// 库存查询
import inventory from '@/views/storesmg/inventory';
// 材料管理
import material from '@/views/storesmg/material';
// 仓库管理
import store from '@/views/storesmg/store';


/**
 * 系统管理
 */
// 用户管理
import user from '@/views/system/user';
// 角色管理
import role from '@/views/system/role';
// 公告管理
import notice from '@/views/system/notice';

/**
 * 个人中心
 */
// 我的信息
import account from '@/views/account/account';
// 我的申请
import myapply from '@/views/account/myapply';
// 我的任务
import mytask from '@/views/account/mytask';


/**
 * 数据报表界面
 */
// 静态参考
import statistics from '@/views/charts/statistics';
// // 入库可视化
// import chartin from '@/views/charts/chartin';
// // 出库可视化
// import chartout from '@/views/charts/chartout';
// , {
//     path: '/charts/chartin',
//     name: '入库可视化',
//     component: chartin,
//     meta: {
//         requireAuth: true
//     }
// }, {
//     path: '/charts/chartout',
//     name: '出库可视化',
//     component: chartout,
//     meta: {
//         requireAuth: true
//     }
// }

// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/sign',
        name: '注册',
        component: sign,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/test',
        name: '测试',
        component: test,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/welcome/welcome',
            name: '首页',
            component: welcome,
            meta: {
                requireAuth: true
            }
        },{
            path: '/apply/inapply',
            name: '入库申请',
            component: inapply,
            meta: {
                requireAuth: true
            }
        },{
            path: '/apply/outapply',
            name: '出库申请',
            component: outapply,
            meta: {
                requireAuth: true
            }
        },{
            path: '/in/inselect',
            name: '入库查询',
            component: inselect,
            meta: {
                requireAuth: true
            }
        },{
            path: '/out/outselect',
            name: '出库查询',
            component: outselect,
            meta: {
                requireAuth: true
            }
        },{
            path: '/apply/transferapply',
            name: '库存转移申请',
            component: transferapply,
            meta: {
                requireAuth: true
            }
        },{
            path: '/store/inventory',
            name: '库存查询',
            component: inventory,
            meta: {
                requireAuth: true
            }
        },{
            path: '/store/material',
            name: '材料管理',
            component: material,
            meta: {
                requireAuth: true
            }
        },{
            path: '/store/store',
            name: '仓库管理',
            component: store,
            meta: {
                requireAuth: true
            }
        },{
            path: '/system/user',
            name: '用户管理',
            component: user,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/role',
            name: '角色管理',
            component: role,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/notice',
            name: '公告管理',
            component: notice,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/charts/statistics',
            name: '库存可视化',
            component: statistics,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/account/account',
            name: '我的信息',
            component: account,
            meta: {
                requireAuth: true
            }
        },{
            path: '/account/myapply',
            name: '我的申请',
            component: myapply,
            meta: {
                requireAuth: true
            }
        },{
            path: '/account/mytask',
            name: '我的任务',
            component: mytask,
            meta: {
                requireAuth: true
            }
        }]
    }]
})